import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Index from '../views/Index'
import Main from "../views/Main";
import Website from '../views/Website'
import Study from "../views/Study";
import Essence from "../views/Essence"
import Details from "../views/Details";
import AboutUs from "../views/AboutUs"
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    name: 'index',
    component: Index,
    redirect:"/main",
    children:[
      {
        path:"/main",
        name:"Main",
        component: Main
      },
      {
        path:"/website",
        name:"Website",
        component: Website
      },
      {
        path:"/study",
        name:'study',
        component: Study
      },
      {
        path: '/about/:myid',
        name: 'About',
        component: () => import(/* webpackChunkName: "about" */ '../views/About.vue'),
        //设置只有登录后才能访问的
        meta:{
          requireAuth:true
        }
      },
      {
        path:"/essence",
        name:"Essence",
        component: Essence
      },{
        path:"/details/:myid",
        name:"Details",
        component: Details
      },
      {
        path:"/aboutUs",
        name:"AboutUs",
        component: AboutUs
      },
      {
        path:"/search/:seek",
        name:"Search",
        component:() =>import('../views/Search')
      },
      {
        path:"/questionBank",
        name:"questionBank",
        component:() =>import ('../views/QuestionBank')
      },
      {
        path:"/testQuestions",
        name:'testQuestions',
        component:()=>import('../views/test-questions/testQuestions')
      }

    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
